<template>
</template>

<script setup>
	import {
		ref
	} from 'vue';
	import {
		onLaunch
	} from '@dcloudio/uni-app';
	const statusBarHeight = ref('0px')
	onLaunch(() => {
		const systemInfo = uni.getSystemInfoSync()
		statusBarHeight.value = `${systemInfo.statusBarHeight || 44}px`

		uni.login({
			success: (res) => {
				let {
					code
				} = res;
				uni.request({
					url: 'http://47.98.187.80:5000/api/getopenid',
					method: "POST",
					data: {
						code
					},
					success: (res) => {
						let {
							openid
						} = res.data;
						uni.setStorageSync('openid', openid)
					}
				})
			}
		})
	})
</script>

<style>
	/*每个页面公共css */
	page {
		box-sizing: border-box;
	}
</style>